﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using SmartIot.AspnetCore.Mapper;
using SmartIot.Infrastructure.Mapper;
using SmartIot.MicroService.SolarTerms.Dto;

namespace SmartIot.MicroService.SolarTerms.Mapper
{
    public class MapperProfile : Profile, IProfile
    {
        public MapperProfile()
        {
            CreateMap<SmartIot.Models.SolarTerms.TermsAlbum, TermsAlbumDto>();
            CreateMap<TermsAlbumDto, SmartIot.Models.SolarTerms.TermsAlbum>()
                .ForMember(dest => dest.TermsName, opt => opt.Ignore())
                .ForMember(dest => dest.Extends, opt => opt.Ignore());

            CreateMap<SmartIot.Models.SolarTerms.TermsArticle, TermsArticleDto>();
            CreateMap<TermsArticleDto, SmartIot.Models.SolarTerms.TermsArticle>()
                .ForMember(dest => dest.TermsName, opt => opt.Ignore())
                .ForMember(dest => dest.Extends, opt => opt.Ignore());

            CreateMap<SmartIot.Models.SolarTerms.TermsCategory, TermsCategoryDto>();
            CreateMap<TermsCategoryDto, SmartIot.Models.SolarTerms.TermsCategory>()
                .ForMember(dest => dest.Extends, opt => opt.Ignore());

            CreateMap<SmartIot.Models.SolarTerms.Terms, TermsDto>();
            CreateMap<TermsDto, SmartIot.Models.SolarTerms.Terms>()
                .ForMember(dest => dest.Extends, opt => opt.Ignore());

            CreateMap<SmartIot.Models.SolarTerms.TermsTime, TermsTimeDto>();
            CreateMap<TermsTimeDto, SmartIot.Models.SolarTerms.TermsTime>()
                .ForMember(dest=>dest.TermsName, opt=>opt.Ignore())
                .ForMember(dest => dest.Extends, opt => opt.Ignore());
        }
    }
}
